package com.tca.spring.framework.learning.ioc;

import com.tca.spring.framework.learning.ioc.circulardependency.A;
import com.tca.spring.framework.learning.ioc.config.ScanConfiguration;
import com.tca.spring.framework.learning.ioc.config.StudentConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author zhoua
 * @Date 2021/5/1
 */
public class SpringScanAnnotationStarter {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ScanConfiguration.class);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (String name: beanDefinitionNames) {
            System.out.println(name);
        }
        System.out.println(applicationContext.getBean("com.tca.spring.framework.learning.ioc.circulardependency.A")
            == applicationContext.getBean(A.class));

    }
}
